import { request } from '@pkg/request/src';

export enum Api {
  page = '/viponly/page',
  list = '/viponly/list',
  get = '/viponly/get',
  add = '/viponly/save',
  update = '/viponly/update',
  remove = '/viponly/remove',
}

export const list = () => request.get({ url: Api.list }, { errorMessageMode: 'none', successMessageMode: 'none' });

export const getViponlyDetail = params =>
  request.get(
    { url: Api.get, params: params },
    {
      errorMessageMode: 'none',
      successMessageMode: 'none',
    },
  );

export const add = params => request.post({ url: Api.add, params: params }, { errorMessageMode: 'message' });

export const update = params => request.post({ url: Api.update, params: params }, { errorMessageMode: 'message' });
